﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MaLu.Common;
using System.Data;
using MaLu.BusiLogic;

namespace MaluJg.web.Stats02.financial
{
    public partial class Index : BasicPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                DataTable dt = BLFarm.GetMoneyDetailByVillageIDAndYear(Provider, Year, VillageID);
                dt.Columns.Add("BuTie");

                string type = HttpUtility.UrlDecode(Request["typeval"] ?? "FHuaFei"); 
                bool hasType = dt.Columns.Contains(type);
                foreach (DataRow item in dt.Rows)
                {
                    if(hasType)
                    {
                        item["BuTie"] = item[type];

                    }
                }

                rptInfo.DataSource = dt;
                rptInfo.DataBind();

            }
        }

        public string TypeValue
        {
            get
            {
                string _v = HttpUtility.UrlDecode(Request["typeval"] ?? "FHuaFei"); 
                return _v;
            }

        }
        public string TypeStr
        {
            get
            {
                string _v = HttpUtility.UrlDecode(Request["typeval"] ?? string.Empty);

                if (_v == "FBooth")
                {
                    _v = "摊位";
                }
                else if (_v == "FHuaFei")
                { _v = "有机肥"; }
                else if (_v == "FCold")
                { _v = "冷库"; }
                else if (_v == "FGreen")
                { _v = "大棚"; }
                else if (_v == "FMembrane")
                { _v = "银灰膜"; }
                else if (_v == "FPackage")
                { _v = "包装箱"; }

                return _v;
            }

        }
    }
}
